package com.cn;

import org.flowable.common.engine.impl.AbstractEngineConfiguration;
import org.flowable.engine.ProcessEngine;
import org.flowable.engine.ProcessEngineConfiguration;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.impl.cfg.StandaloneProcessEngineConfiguration;
import org.flowable.engine.repository.Deployment;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * 配置方式
 */
@SpringBootTest
public class flowableTest04 {


    /**
     * 配置信息方式
     */
    @Test
    void testProcessEngine(){
        ProcessEngineConfiguration cfg = new StandaloneProcessEngineConfiguration()
                //连接的url信息
                .setJdbcUrl("")
                //数据连接信息
                .setJdbcDriver("")
                //用户名称
                .setJdbcUsername("")
                //密码
                .setJdbcPassword("")
                .setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);


        //获取用户对象方式
        RepositoryService repositoryService = cfg.getRepositoryService();

        //创建文件方式
        Deployment deploy = repositoryService.createDeployment()
                //添加xml文件路径
                .addClasspathResource("")
                //名称
                .name("")
                .deploy();
    }


}
